#ifndef DOMINIO_H_
#define DOMINIO_H_

#include <iostream>
#include <list>
#include <string>
#include <ctime>
#include "URLFeliz.h"
#include "TimedURL.h"
#include "Robots.h"

class Dominio {
public:
	Dominio(){};
	Dominio(const std::string &aName, const std::string &theRobots, const std::time_t &time, const bool robotsValido);
	virtual ~Dominio() {}
	
	TimedURL getNextURL();
	void updateTimestamp(time_t newTimestamp) { 
		timestamp = newTimestamp;
		_podeMaisUm = true;
	}
	void insertNextURL(const URLFeliz urlFeliz) { 
		if (robots.isAllowed(urlFeliz.getPath()))
			urlList.push_back(urlFeliz); 
	}
		
	std::list<URLFeliz> getURLList() {return urlList;}
	std::string getName() {return name;}
	//Robots getRobots() {return robots;}
	std::time_t getTimestamp() {return timestamp;}
	bool podeMaisUm() {return _podeMaisUm;}
	//bool robotsValido() {return _robotsValido;}
	
private:
	std::string name;
	std::list <URLFeliz> urlList;
	Robots * robots;
	std::time_t timestamp;
	bool _podeMaisUm;
	//bool _robotsValido;
	static const int timeBetweenVisits;
};



#endif /*DOMINIO_H_*/
